/**
 * TableSet.java
 *
 * Copyright (c) 2010 Prj.Manager All Rights Reserved.
 *
 * This source file may not be copied, modified or redistributed,
 * in whole or in part, in any form or for any reason, without the express
 * written consent of Prj.Manager .
 **/

package ro.prjmanager.model;


import javax.persistence.*;

/**
 * This class from the domain model is mapping the table table_set
 * @author Viorel Tacliciu
 * @version 2
 */

@Table(name="table_set")
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public class  TableSet{

    //define attributes that maps all columns of the coresponding table
    //this attribute maps the primary key column ID
    private java.lang.Integer id;
    //define attributes that maps all columns of the coresponding table
    //this attribute maps the column TABLE_NAME
    private  java.lang.String  tableName;
    //end mapping columns
     //this attribute maps the foreign key column FK_PROJECT_DB
    private ProjectDb fkProjectDb;
    //define getters and setters with corresponding ejb3 annotation, depending of the type
    //of the relation for the column

     /**
     * Mapping the primary key
     * @return - java.lang.Integer the primary key for this entity
     **/
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "ID")
    public  java.lang.Integer  getId(){
        return this.id;
    }

    /**
     * The setter for ID column
     * @param id -  an java.lang.Integer object
     **/
    public void setId( java.lang.Integer  id){
        this.id=id;
    }
    /**
     * This method gets the tableName attribute
     * @return - an  java.lang.String  object
     **/
    @Column(name = "TABLE_NAME")
    public  java.lang.String  getTableName(){
        return this.tableName;
    }

    /**
     * The setter for TABLE_NAME column
     * @param tableName -  an  java.lang.String  object
     **/
    public void setTableName( java.lang.String  tableName){
        this.tableName=tableName;
    }

     /**
     * This method maps an ManyToOne relation between this entity and
     * project_db entity
     * @return - an ProjectDb object
     **/
    @ManyToOne(cascade=CascadeType.REFRESH, fetch = FetchType.LAZY)
    @JoinColumn(name = "FK_PROJECT_DB",referencedColumnName = "ID")
    public ProjectDb getFkProjectDb(){
        return this.fkProjectDb;
    }

    /**
     * This method sets the field fkProjectDb of this entity
     * @param fkProjectDb - an ProjectDb object
     **/
    public void setFkProjectDb(ProjectDb fkProjectDb){
        this.fkProjectDb=fkProjectDb;
    }
}



